<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
if($_RQ['op']=='get'){
	$page=core_setting('site');
	$return=array(
		'verify_code'=>$_AR['system']['verify_code'],
		'logo'=>$page['logo'],
		'llogo'=>$page['llogo'],
		'item'=>array()
	);
	$return['hdps']=array();
	$return['news']=array();
	$return['notice']=array();
	$return['update']=array();
	$return['news']=array();
	$operating=core_setting('operating');
	$return['site']=$page;
	$return['operating']=$operating;
	$return['hdps']=$page['hdps'];
	$fields=array('id','title','paixu','image','status','group_id','content','type','createtime');
    $orderby=' id desc';
	$total='';
	$return['newsnav']=pdo_getall('core_article_group',array('type'=>0),'','','id asc');
	if(empty($return['newsnav'])){
		$return['newsnav']=array(
			array('id'=>1,'title'=>'行业动态'),
			array('id'=>2,'title'=>'公司动态'),
			array('id'=>3,'title'=>'运营学院'),
			array('id'=>4,'title'=>'产品视频'),
		);
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 36;
	$return['news']=pdo_getslice('core_article',array('status'=>1,'type'=>0), array($pindex,$psize), $total,$fields,'',$orderby);
	if(empty($return['news'])){
		$return['news']=array(
			array('group_id'=>1,'title'=>'‘后端,前端分离’,MVC变异版,为移动应用而生,为智能而生。','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'一个后台，全网发布，数据统一，体验统一','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'参考小程序机制GET机制，非常适合手机移动端体验！','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'相比其他常规TPL程序，加载速度要快3倍左右。','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'每个功能都是一个接口，功能之间多维度智能扣环！','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'组件化是实现智能AI的基础,AI智能先人一步','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'功能强大，支持囤货分销和不囤货分销','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'同步平台会员信息，可快速下单快店、团购、快速买单等业务','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'精准、高效解决旅游行业多渠道的分销推广','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
			array('group_id'=>1,'title'=>'滴滴有的都有:地图路径规划，算距离，算时常，实时定位','createtime'=>date('Y-m-d H:i:s',TIMESTAMP)),
		);
	}
	if($return['news']){
		foreach($return['news'] as &$item){
			$item['content'] = strip_tags(str_replace('&nbsp;','',$item['content']));
			$item['desc'] = $item['description'] ? $item['description'] : cfc('tools')->substr($item['content'],0,36);
			$item['createtime']=date('Y-m-d',$item['createtime']);
			$item['url'] = manage_url('/home.news/detail/id='.$item['id']);
		}
	}
	foreach($return['newsnav'] as $k=>&$item){
		$news = array();
		$i = 0;
		foreach($return['news'] as &$al){
				if($al['group_id'] == $item['id'] && $i <36){
					$news[$i] = $al;
					$i +=1;
				}
		}
		$item['news'] = $news;
		if($k >5){
			unset($item);
		}
	}
	if($return['site']['wxappnav']){
		foreach($return['site']['wxappnav'] as $k=>&$item){
			$anlis = array();
			foreach($return['site']['wxappanlis'] as $i=>&$al){
				if($al['navid'] == $k){
					$anlis[$i] = $al;
				}
			}
			$item['anlis'] = $anlis;
		}
	}
	if($return['site']['wxnav']){
		foreach($return['site']['wxnav'] as $k=>&$item){
			$anlis = array();
			foreach($return['site']['wxanlis'] as $i=>&$al){
				if($al['navid'] == $k){
					$anlis[$i] = $al;
				}
			}
			$item['anlis'] = $anlis;
		}
	}
	if($return['site']['mobilenav']){
		foreach($return['site']['mobilenav'] as $k=>&$item){
			$anlis = array();
			foreach($return['site']['mobileanlis'] as $i=>&$al){
				if($al['navid'] == $k){
					$anlis[$i] = $al;
				}
			}
			$item['anlis'] = $anlis;
		}
	}
	if($return['site']['pcnav']){
		foreach($return['site']['pcnav'] as $k=>&$item){
			$anlis = array();
			foreach($return['site']['pcanlis'] as $i=>&$al){
				if($al['navid'] == $k){
					$anlis[$i] = $al;
				}
			}
			$item['anlis'] = $anlis;
		}
	}
	$return['tpl']=array();
	$return['tpl']['siteid']=$_SESSION['website_id'];
	$return['account']=$page;
	$return['extradata']=array();
	$return['sharedata']=array(
		'title'=>$page['title']?$page['title']:'一站式小程序解决方案',
		'desc'=>$page['desc']?$page['desc']:'一个后台，全网发布，数据统一，体验统一',
		'link'=>manage_url('core/home.welcome//fromuser='.$_SESSION['uniacid'],true),
		'imgUrl'=>ATTACHMENT_URL.$page['logo']
	);
	set_html('header','common/header-cms');
	exi($return);
}
?>